﻿/*
Post-Deployment Script Template							
--------------------------------------------------------------------------------------
 This File contains SQL statements that will be appended to the build script.		
 Use SQLCMD syntax to include a File in the post-deployment script.			
 Example:      :r .\myFile.sql								
 Use SQLCMD syntax to reference a variable in the post-deployment script.		
 Example:      :setvar TableName MyTable							
               SELECT * FROM [$(TableName)]					
--------------------------------------------------------------------------------------
*/
USE [SharePointOptimizer]
GO
/****** Object:  Table [dbo].[Category]    Script Date: 04/12/2012 13:24:12 ******/
INSERT [dbo].[Category] ([CategoryId], [Description]) VALUES (1, N'Storage')
INSERT [dbo].[Category] ([CategoryId], [Description]) VALUES (2, N'Security')
INSERT [dbo].[Category] ([CategoryId], [Description]) VALUES (3, N'Backup/Restore')
INSERT [dbo].[Category] ([CategoryId], [Description]) VALUES (4, N'Network')
INSERT [dbo].[Category] ([CategoryId], [Description]) VALUES (5, N'Customization')
INSERT [dbo].[Category] ([CategoryId], [Description]) VALUES (6, N'Configuration')
INSERT [dbo].[Category] ([CategoryId], [Description]) VALUES (7, N'Performance')
INSERT [dbo].[Category] ([CategoryId], [Description]) VALUES (8, N'Memory')
/****** Object:  Table [dbo].[Scope]    Script Date: 04/12/2012 13:24:12 ******/
INSERT [dbo].[Scope] ([ScopeId], [Description]) VALUES (1, N'Farm')
INSERT [dbo].[Scope] ([ScopeId], [Description]) VALUES (2, N'Web Application')
INSERT [dbo].[Scope] ([ScopeId], [Description]) VALUES (3, N'Site Collection')
INSERT [dbo].[Scope] ([ScopeId], [Description]) VALUES (4, N'Site')
INSERT [dbo].[Scope] ([ScopeId], [Description]) VALUES (5, N'List')
INSERT [dbo].[Scope] ([ScopeId], [Description]) VALUES (6, N'Content Database')
INSERT [dbo].[Scope] ([ScopeId], [Description]) VALUES (7, N'Server')
/****** Object:  Table [dbo].[Recommendation]    Script Date: 04/12/2012 13:24:12 ******/
INSERT [dbo].[Recommendation] ([RecommendationId], [Description], [HowToTitle], [HowToUrl]) VALUES (1001, N'Schedule a daily backup in Central Administration.', N'How to set up a daily backup in SharePoint.', NULL)
INSERT [dbo].[Recommendation] ([RecommendationId], [Description], [HowToTitle], [HowToUrl]) VALUES (1002, N'Check if some of the applications can be archived, removed or moved to another farm.', N'How to reduce the number of webApplications.', NULL)
INSERT [dbo].[Recommendation] ([RecommendationId], [Description], [HowToTitle], [HowToUrl]) VALUES (2001, N'Remove or archive sitecollections that are not being used.', NULL, NULL)
INSERT [dbo].[Recommendation] ([RecommendationId], [Description], [HowToTitle], [HowToUrl]) VALUES (2002, N'Check if some of the sitecollections can be moved to another web application.', NULL, NULL)
INSERT [dbo].[Recommendation] ([RecommendationId], [Description], [HowToTitle], [HowToUrl]) VALUES (2003, N'Disable debugging mode for this web application.', N'How to disable debugging mode', NULL)
INSERT [dbo].[Recommendation] ([RecommendationId], [Description], [HowToTitle], [HowToUrl]) VALUES (3002, N'Remove or archive sites that are not being used anymore.', N'How to remove or archive non used sites.', NULL)
INSERT [dbo].[Recommendation] ([RecommendationId], [Description], [HowToTitle], [HowToUrl]) VALUES (4001, N'Remove or archive libraries that are not being used.', NULL, NULL)
INSERT [dbo].[Recommendation] ([RecommendationId], [Description], [HowToTitle], [HowToUrl]) VALUES (4002, N'Consider redesigning your site structure.', N'Best practices for designing sites structure', NULL)
INSERT [dbo].[Recommendation] ([RecommendationId], [Description], [HowToTitle], [HowToUrl]) VALUES (5001, N'Remove or archive files that are not being used anymore.', N'How to remove or archive non used Files', NULL)
INSERT [dbo].[Recommendation] ([RecommendationId], [Description], [HowToTitle], [HowToUrl]) VALUES (5002, N'Distribute your files over more lists.', N'Best practices for designing document libraries', NULL)
INSERT [dbo].[Recommendation] ([RecommendationId], [Description], [HowToTitle], [HowToUrl]) VALUES (6001, N'Split your database into smaller databases.', N'How to split a database', NULL)
INSERT [dbo].[Recommendation] ([RecommendationId], [Description], [HowToTitle], [HowToUrl]) VALUES (7001, N'Free up space on the server.', NULL, NULL)
INSERT [dbo].[Recommendation] ([RecommendationId], [Description], [HowToTitle], [HowToUrl]) VALUES (7002, N'Add more RAM to your srever.', NULL, NULL)
/****** Object:  Table [dbo].[IssueType]    Script Date: 06/22/2012 16:19:08 ******/
INSERT [dbo].[IssueType] ([IssueTypeId], [CategoryId], [ScopeId], [Severity], [Description], [ThresholdValue], [ThresholdDescription]) VALUES (1001, 3, 1, 2, N'The last complete backup of this farm was on {backupdate}. It is recommended to make a backup daily.', 1, N'Maximum number of days since the last backup.')
INSERT [dbo].[IssueType] ([IssueTypeId], [CategoryId], [ScopeId], [Severity], [Description], [ThresholdValue], [ThresholdDescription]) VALUES (1002, 1, 1, 1, N'The number of webapplications in this farm is {nrWebApps}. It is recommended not to exceed {maxNrWebApps} webapplications.', 2, N'Maximum number of webapplications in a farm.')
INSERT [dbo].[IssueType] ([IssueTypeId], [CategoryId], [ScopeId], [Severity], [Description], [ThresholdValue], [ThresholdDescription]) VALUES (2001, 1, 2, 1, N'The number of sitecollections in {webAppName} is {nrSiteCols}. It is not recommended to exceed {maxNrSiteCols} in one Web Application', 250000, N'Maximum amount of site collections in one web application.')
INSERT [dbo].[IssueType] ([IssueTypeId], [CategoryId], [ScopeId], [Severity], [Description], [ThresholdValue], [ThresholdDescription]) VALUES (2002, 6, 2, 2, N'The blob caching for webapplication: {webAppName} is not enabled. It is recommended to enable blob caching for better performance.', 0, N'Enabled or disabled')
INSERT [dbo].[IssueType] ([IssueTypeId], [CategoryId], [ScopeId], [Severity], [Description], [ThresholdValue], [ThresholdDescription]) VALUES (2003, 6, 2, 1, N'The debug mode is enabled for web application:  {weAppName}. It is recommended to disable debug mode for better performance.', 1, N'disabled or enabled')
INSERT [dbo].[IssueType] ([IssueTypeId], [CategoryId], [ScopeId], [Severity], [Description], [ThresholdValue], [ThresholdDescription]) VALUES (3002, 1, 3, 1, N'The number of sites in {sitecolName} is {nrSites}. It is recommended not to exceed {maxSites} sites in one sitecollection.', 250000, N'Maximum number of sites in the sitecollection')
INSERT [dbo].[IssueType] ([IssueTypeId], [CategoryId], [ScopeId], [Severity], [Description], [ThresholdValue], [ThresholdDescription]) VALUES (4001, 1, 4, 1, N'The number of libraries in site {siteURL} is {nrLibraries}. It is not recommended to exceed {maxNrLibraries} in one site', 2000, N'Maximum amount of libraries in one site')
INSERT [dbo].[IssueType] ([IssueTypeId], [CategoryId], [ScopeId], [Severity], [Description], [ThresholdValue], [ThresholdDescription]) VALUES (4002, 1, 4, 1, N'The site: {siteURL} is {deeplev} times nested. It is not recommended to have subsites nested more than {maxlev} times.', 7, N'Max level of deepth')
INSERT [dbo].[IssueType] ([IssueTypeId], [CategoryId], [ScopeId], [Severity], [Description], [ThresholdValue], [ThresholdDescription]) VALUES (5001, 1, 5, 1, N'The number of files in {listName} is {nrFiles}. It is not recommended to exceed {maxnrFiles} files in one list.', 30000000, N'Maximum number of files in the list.')
INSERT [dbo].[IssueType] ([IssueTypeId], [CategoryId], [ScopeId], [Severity], [Description], [ThresholdValue], [ThresholdDescription]) VALUES (5002, 1, 5, 1, N'The size of {listName} list is {listSize}. It is not recommended to store lists larger than {maxListSize}', 30000000, N'Maximum size of the list (MB)')
INSERT [dbo].[IssueType] ([IssueTypeId], [CategoryId], [ScopeId], [Severity], [Description], [ThresholdValue], [ThresholdDescription]) VALUES (6001, 1, 6, 3, N'The size of the database: {dbname} is {dbsize} GB. It is not recommended to exceed {maxSize} GB ', 50, N'max size for db')
INSERT [dbo].[IssueType] ([IssueTypeId], [CategoryId], [ScopeId], [Severity], [Description], [ThresholdValue], [ThresholdDescription]) VALUES (7001, 1, 7, 2, N'The amount of free space on the server {serverName} on disk: {diskname} is too low. It is recommended to keep at least {minFreeSpace}% of free space on each disk.', 10, N'Minimum amount of free space on the server (%).')
INSERT [dbo].[IssueType] ([IssueTypeId], [CategoryId], [ScopeId], [Severity], [Description], [ThresholdValue], [ThresholdDescription]) VALUES (7002, 8, 7, 3, N'The amount of RAM on server: {ServerName} is {nrRAM} MB. It recommended to have at least {minRAM} MB of RAM on the server.', 8, N'Minimum ram')
/****** Object:  Table [dbo].[RecommendationIssueType]    Script Date: 06/22/2012 16:19:08 ******/
INSERT [dbo].[RecommendationIssueType] ([RecommendationId], [IssueTypeId], [Order]) VALUES (1001, 1001, 1)
INSERT [dbo].[RecommendationIssueType] ([RecommendationId], [IssueTypeId], [Order]) VALUES (1002, 1002, 1)
INSERT [dbo].[RecommendationIssueType] ([RecommendationId], [IssueTypeId], [Order]) VALUES (2001, 2001, 1)
INSERT [dbo].[RecommendationIssueType] ([RecommendationId], [IssueTypeId], [Order]) VALUES (2002, 2001, 2)
INSERT [dbo].[RecommendationIssueType] ([RecommendationId], [IssueTypeId], [Order]) VALUES (2002, 2002, 1)
INSERT [dbo].[RecommendationIssueType] ([RecommendationId], [IssueTypeId], [Order]) VALUES (2003, 2003, 1)
INSERT [dbo].[RecommendationIssueType] ([RecommendationId], [IssueTypeId], [Order]) VALUES (3002, 3002, 1)
INSERT [dbo].[RecommendationIssueType] ([RecommendationId], [IssueTypeId], [Order]) VALUES (4001, 4001, 1)
INSERT [dbo].[RecommendationIssueType] ([RecommendationId], [IssueTypeId], [Order]) VALUES (4002, 4002, 1)
INSERT [dbo].[RecommendationIssueType] ([RecommendationId], [IssueTypeId], [Order]) VALUES (5001, 5001, 1)
INSERT [dbo].[RecommendationIssueType] ([RecommendationId], [IssueTypeId], [Order]) VALUES (5001, 5002, 2)
INSERT [dbo].[RecommendationIssueType] ([RecommendationId], [IssueTypeId], [Order]) VALUES (6001, 6001, 1)
INSERT [dbo].[RecommendationIssueType] ([RecommendationId], [IssueTypeId], [Order]) VALUES (7001, 7001, 1)
INSERT [dbo].[RecommendationIssueType] ([RecommendationId], [IssueTypeId], [Order]) VALUES (7002, 7002, 1)
